import QtQuick 2.4

NewTaskComponentForm {

    function getFocus(){
        textTodoNewS.forceActiveFocus();
    }
    textTodoNewS.onTextEdited: {
        if (textTodoNewS.text.trim() !==""){
            btnAddTask.enabled=true;
        }else{
            btnAddTask.enabled=false;
        }
    }

    btnAddTask.onClicked: {
        var textValue = textTodoNewS.text.trim();
        if (textValue === "")
            return;

            textTodoNewS.text = "";
//        newTaskInputRowId.visible = false;
//        toolButton.visible = true;

//        Qt.inputMethod.hide()
        backend.newTask(textValue);
        //TODO fill other info
        listView.positionViewAtEnd();
    }
}
